#ifndef SCRIPT_TRANSLATOR_H
#define SCRIPT_TRANSLATOR_H

#include <string>
#include <optional>
#include <global.h>
#include "scripting/script_header.h"
#include "scheduler/abstract_scheduler.h"

namespace script
{

class ScriptTranslatorData;
/**
 * @brief:  脚本翻译器，对AST进行翻译，到这里的AST是经过与发分析的
 * @author: sherlock_lht
 */
class ScriptTranslator
{
public:
    explicit ScriptTranslator();
    ~ScriptTranslator();

    /**
     * @brief:  翻译语法树
     * @return: 返回任务编排器
     * @author: sherlock_lht
     */
    std::optional<scheduler::AbstractSchedulerConstPtr> translate(const ASTNode &ast_node);

    void getLastInfo(int *error_line, int *error_column, std::string *error_message) const;

private:
    DECLARE_DATA(ScriptTranslator)
};
}
#endif //SCRIPT_TRANSLATOR_H
